//提示，显示与隐藏
$("input").click(function(){
    var name=$(this).attr("name");
    $(".text_msg").css("display","none");
    $("#"+name+"_msg").css("display","inline");
})
            $(".submit").click(function(){
                 var title=$("#title").val();
                 var content=$("#content").val(); 
                 if(title=="" || content==""){
                    $("#title_msg").css("color","red");
                    $("#title_msg").html("请输入标题");
                    $("#content_msg").css("color","red");
                    $("#content_msg").html("请输入内容");
                }else{
                 $.ajax({
                    type:"get",
                    url:"./index.php?m=Index&c=new&a=newadd",
                    data:{title:title,content:content},
                    success:function(a){
                        if(a == 1){
                             alert('添加成功');window.location.href="index.php?m=Index&c=index&a=index";  
                        }else {
                            alert('添加失败');
                         }
                        }
                    });
                }
            });
